/*---------------------------------------------------
-----------------------------------------------------
Filename:	dbuttons.m
Version:	1.0

Type:		maki
Date:		03. nOV. 2006 - 17:02 
Author:		Martin Poehlmann aka Deimos
E-Mail:		martin@skinconsortium.com
Internet:	www.skinconsortium.com
		www.martin.deimos.de.vu
-----------------------------------------------------
---------------------------------------------------*/

#include <lib/std.mi>

Class ToggleButton InfoButton;

Global InfoButton b_pl, b_eq;
Global Text SongTicker;
Global Group buttongroup;
Global GuiObject glow;

System.onScriptLoaded ()
{
	buttongroup = getScriptGroup();
	b_pl = buttongroup.getObject("playlist");
	b_eq = buttongroup.getObject("equalizer");

	glow = buttongroup.getObject("glow");

	SongTicker = buttongroup.getParentLayout().findObject("songticker");
}

InfoButton.onLeftClick ()
{
	if (InfoButton == b_eq)
	{
		if (getCurCfgVal() == 1)
		{
			SongTicker.sendAction("showinfo", "Show Equalizer", 0, 0, 0, 0);
		}
		else
		{
			SongTicker.sendAction("showinfo", "Hide Equalizer", 0, 0, 0, 0);
		}
	}
	else if (InfoButton == b_pl)
	{
		if (getCurCfgVal() == 1)
		{
			SongTicker.sendAction("showinfo", "Show Paylist", 0, 0, 0, 0);
		}
		else
		{
			SongTicker.sendAction("showinfo", "Hide Playlist", 0, 0, 0, 0);
		}
	}
}

InfoButton.onEnterArea ()
{
	glow.cancelTarget();
	glow.setTargetA(50);
	glow.setTargetSpeed(0.3);
	glow.gotoTarget();
}

InfoButton.onLeaveArea ()
{
	glow.cancelTarget();
	glow.setTargetA(0);
	glow.setTargetSpeed(0.6);
	glow.gotoTarget();
}